﻿namespace Singleton.Sample.Implementations
{
    /// <summary>
    /// PS: Keyword "sealed" is used for JIT optimizations
    /// </summary>
    public sealed class Singleton_1_NonThreadSafe
    {
        private static Singleton_1_NonThreadSafe instance = null;
        private Singleton_1_NonThreadSafe() { }

        public static Singleton_1_NonThreadSafe Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new Singleton_1_NonThreadSafe();
                }
                return instance;
            }
        }
    }
}